import {  Controller, Get, Inject, Query } from "@midwayjs/decorator";
import { Validate } from "@midwayjs/validate";
import { PhotoAdd } from "../dto/photo.dto";
import { PhotoService } from "../service/photo.service";

@Controller('/api/photo')
export class PhotoController {

    @Inject()
    photoService: PhotoService

    @Get('/add') 
    @Validate()
    async add(@Query() dto: PhotoAdd){
        await this.photoService.add('bvidlbvlfdbvldbs');
        return {code: 200, msg: '大概'}
    }

    @Get('/update')
    async update() {
        throw new Error('报错测试')
    }
}